import request from '@/service/index'
import { Account} from './types'

enum LoginAPI {
  AccountLogin = '/login',
  UserInfo = '/users/',
  UserMeuns = '/role/',
}

export function accountLogin(account: Account) {
  return request.post({
    url: LoginAPI.AccountLogin,
    data: account
  })
}

export function getUserById(id: number) {
  return request.get({
    url: LoginAPI.UserInfo + id
  })
}
export function getUserMenus(id: number) {
  return request.get({
    url: LoginAPI.UserMeuns + id + '/menu'
  })
}
